package com.ooono.factorytest.items;

import static com.ooono.factorytest.model.TestItem.STATE_SUCCESS;

import android.view.View;

import com.ooono.factorytest.R;
import com.ooono.factorytest.base.BaseActivity;
import com.ooono.factorytest.utils.SPUtils;
import com.ooono.factorytest.view.TouchTestView;

import mcs8.mdm.PolicyManager;

public class TouchTestActivity extends BaseActivity implements TouchTestView.CallBack {

    private static final String TAG = "TouchTestActivity";

    public static final String KEY = "touch";

    TouchTestView mTouchTestView;

    @Override
    public int getTestTitle() {
        return -1;
    }

    @Override
    public String getTestKey() {
        return KEY;
    }

    @Override
    public int getContentLayout() {
        return R.layout.content_touch_test;
    }

    @Override
    protected void onResume() {
        super.onResume();
        bottomButtonCl.setVisibility(View.GONE);
        PolicyManager.setNotificationBarEnable(false);
    }

    @Override
    public void initViews() {
        mTouchTestView = findViewById(R.id.touch_test);
        mTouchTestView.setCallBack(this);
    }

    @Override
    public void onTestCompleted() {
        SPUtils.get(this).saveData(getTestKey(), STATE_SUCCESS);
        PolicyManager.setNotificationBarEnable(true);
        finish();
    }

    @Override
    protected void onPause() {
        PolicyManager.setNotificationBarEnable(true);
        super.onPause();
    }
}